The invention relates to a data buffer, and more particularly to a novel stream data buffer device and an access method thereof.
In general, client program, such as media players, utilize a buffer to temporarily store received streaming media data. When the buffer is full, the client program plays the media data. FIG. 1 is a schematic diagram of a conventional data buffer device. The data buffer device 12 comprises two buffers, first buffer 13 and second buffer 14, to alternatively store the stream data. When the client program 11 connects to a server providing the stream data (not shown in FIG. 1), the client program receives the stream data through the receiving port 15 and the receiving port 15 stores the stream data in first buffer 13. If the first buffer 13 is full, the receiving port 15 stores the stream data in the second buffer 14 and the client program 11 reads the stream data of the first buffer 13. If the stream data of the first buffer 13 is completely read and the second buffer 14 is full, the client program 11 reads the stream data of the buffer 14. If the stream data of the first buffer 13 is completely read and the second buffer 14 is not full, the client program 11 reads the stream data of the buffer 14 until the second buffer 14 is full. Thus, the operating performance of the client program is affected by the buffer size. If the buffer size, such as the first buffer 13, is too large, the time required to fill it with data increases. If the buffer size, such as the first buffer 13, is too small, the buffers may fill rapidly, thus, the receiving port 15 can not receive any more data. This affects the playback speed.
Consequently, the conventional buffer of FIG. 1 is not well suited to an embedded system as it cannot provide additional memory for the client program 11. It is desirable that a novel stream data buffer device with smaller memory and higher performance and an access method thereof for the client program is desirable.